package com.atguigu.springbootmq.consumer;

import com.atguigu.springbootmq.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 報警消費者
 */
@Slf4j
@Component
public class WaringConsumer {

    //报警消费者
    @RabbitListener(queues = ConfirmConfig.WARNING_EQUEUE_NAME)
    public void receivWarningMsg(Message message){
        String s = new String(message.getBody());
        log.error("报警发现不可路由消息：{}",s);
    }

}
